home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 December / PCWorld_2004-12_cd.bin / software / temacd / tiny / tf6pro-6[1].0.140.exe / Tiny Firewall Pro 6.0.msi / Event_detail.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-20  |  7.8 KB  |  253 lines

  1. <?xml version='1.0' ?>
  2. <!-- /*//////////////////////////////////////////////////////////////////////
  3. //filename:         log.xsl
  4. //copyright(c):     Tiny Software corp 2002, 2003 (http://www.tinysoftware.com)
  5. //author:         Jozef Palocko (jpalocko@tinysoftware.com)
  6. //product:         Tiny Personal Firewall 5.x                
  7. //description:     Log analyzer stylesheet
  8. //changelog:    
  9. //    18.8.2003 - added displaying date in local time zone
  10. ///////////////////////////////////////////////////////////////////////*/ -->
  11. <xsl:stylesheet version="1.0" 
  12.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  13.     xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  14.     xmlns:time="http://mycompany.com/mynamespace">
  15.  
  16. <xsl:import href="log.xsl"/>
  17. <!--xsl:output method="html" indent="yes" /-->
  18.  
  19.    <xsl:template match="/">
  20.    <style> 
  21.        <xsl:text>
  22.        BODY {
  23.                font-family: "MS Sans serif", "Verdana", "Tahoma" ;
  24.                 font-size: 10px;
  25.                 background-color: #ffffff;  
  26.                 color:#000000;
  27.             }       
  28.         .clsFirewall{
  29.             background-color: e2bde6;
  30.             height:10px;
  31.             }
  32.         .clsSandbox{
  33.             background-color: #f2f7b6;
  34.             height:10px;
  35.             }
  36.         .clsIDS{
  37.             background-color: #ffffd7;  
  38.             height:10px;
  39.             }
  40.         .clsEvent{
  41.             background-color: #fafafa;  
  42.             text-align : left;
  43.            margin-bottom: 10px;
  44.             }    
  45.         .clsAllow{
  46.         color =#2e8b57;
  47.         font-weight : bold;
  48.         }            
  49.         .clsPrevent{
  50.         color =#ff0000;
  51.         font-weight : bold;
  52.         }            
  53.         .clsAskUser{
  54.         color =#00ffff;
  55.         font-weight : bold;
  56.         }            
  57.  
  58.  
  59.        </xsl:text>
  60.        </style>
  61.         
  62.         <xsl:call-template name="tplModule">
  63.             <xsl:with-param name="Events" select="/Root/Event"/>
  64.         </xsl:call-template>
  65.    </xsl:template>
  66.  
  67.  <!-- 
  68.  //////////////////////////////////////
  69.  ///////// Element templates 
  70.  
  71.  -->
  72.  
  73.  
  74.    <!-- ///////// Object //////////// -->
  75.    <xsl:template match="Object">
  76.    <B> Ot: </B>
  77.    <xsl:value-of select="@ot"/>
  78.    <!--xsl:choose>
  79.         <xsl:when test="@ot='0x00000001'">file</xsl:when>
  80.         <xsl:when test="@ot='0x00000002'">service</xsl:when>
  81.         <xsl:when test="@ot='0x00000004'">registry key</xsl:when>
  82.         <xsl:when test="@ot='0x00000008'">Spawning object</xsl:when>
  83.         <xsl:when test="@ot='0x00000010'">Device</xsl:when>
  84.         <xsl:when test="@ot='0x00000020'">VBA Macro</xsl:when>
  85.         <xsl:when test="@ot='0x00000040'">COM object</xsl:when>
  86.         <xsl:when test="@ot='0x00000080'">System privileges</xsl:when>
  87.         <xsl:when test="@ot='0x00000400'">Transport object</xsl:when>
  88.         <xsl:when test="@ot='0x10000000'">Action</xsl:when>
  89.         <xsl:when test="@ot='0x20000000'">Message</xsl:when>
  90.       </xsl:choose-->
  91.       <B>   Object: </B>
  92.       <xsl:value-of select="." />
  93.       <BR />
  94.    </xsl:template>
  95.    
  96.    <!-- ///////// App //////////// -->
  97.    <xsl:template match="App">
  98.       <B>App: </B>
  99.       <xsl:value-of select="." />
  100.       <BR />
  101.       <xsl:if test="@chksm">
  102.          <B> Chksm: </B>
  103.          <xsl:value-of select="@chksm" />
  104.       </xsl:if>
  105.    </xsl:template>
  106.    
  107.    <!-- ///////// Action //////////// -->
  108.    <xsl:template match="Action">
  109.    <B>Message:</B>
  110.      <xsl:value-of select="." />
  111.        <xsl:if test="@fncMsg"> - <xsl:value-of select="@fncMsg" />
  112.       </xsl:if>
  113.  
  114.       <xsl:if test="@fnc">
  115.          <B> Fnc: </B>
  116.          <xsl:variable name="ID" select="@fnc" />    <xsl:value-of select="$Def//Fnc[@id_dec=$ID]" /> (<xsl:value-of select="$ID" />)
  117.          <BR />
  118.       </xsl:if>
  119.    </xsl:template>
  120.    
  121.    <!-- ///////// Msg //////////// -->
  122.    <xsl:template match="Msg">
  123.       <B>Msg: </B>
  124.       <xsl:value-of select="." />
  125.       <br />
  126.    </xsl:template>
  127.    
  128.    <!-- ///////// InetDef //////////// -->
  129.    <xsl:template match="InetDef">
  130.       <B>Prot: </B>
  131.       <xsl:value-of select="@prot" />
  132.       <B>  Dir: </B>
  133.       <xsl:value-of select="@dir" />
  134.       <B>  RemIp: </B>
  135.       <xsl:value-of select="@remIp" />
  136.       <xsl:if test="@locPort">
  137.          <B>  LocPort: </B>
  138.          <xsl:value-of select="@locPort" />
  139.       </xsl:if>
  140.       <xsl:if test="@locPort">
  141.          <B>  RemPort: </B>
  142.          <xsl:value-of select="@remPort" />
  143.          <BR />
  144.       </xsl:if>
  145.       <xsl:if test="@icmpFn">
  146.          <B>  IcmpFn: </B>
  147.          <xsl:value-of select="@icmpFn" />
  148.          <BR />
  149.       </xsl:if>
  150.       <xsl:if test="@locIp">
  151.          <B>  LocIp: </B>
  152.          <xsl:value-of select="@locIp" />
  153.          <BR />
  154.       </xsl:if>
  155.    </xsl:template>
  156.  
  157.    <!-- ///////// Event //////////// -->
  158.    <xsl:template match="Event">
  159.        <xsl:param name="Total"/>
  160.     <xsl:param name="Events"/>
  161.     <xsl:if test="($Filter//cnt=0) or (position()>$Total - $Filter//cnt)">
  162.        <div class="clsEvent" >
  163.       <div >
  164.       <xsl:attribute name="class">
  165.        <xsl:choose>
  166.              <xsl:when test="@module=1">clsSandbox</xsl:when>
  167.           <xsl:when test="@module=2">clsFirewall</xsl:when>
  168.           <xsl:when test="@module=16">clsIDS</xsl:when>
  169.          </xsl:choose>
  170.           </xsl:attribute>
  171.  
  172.          <div style="width:90%;  float: left;  ">
  173.                 <xsl:text>Module: </xsl:text>      
  174.            <xsl:choose>
  175.                      <xsl:when test="@module=1">
  176.                         <b>Windows security</b>
  177.                   </xsl:when>
  178.                   <xsl:when test="@module=2">
  179.                         <b>Firewall</b>
  180.                   </xsl:when>
  181.                   <xsl:when test="@module=16">
  182.                         <b>IDS</b>
  183.                   </xsl:when>
  184.                <xsl:otherwise>
  185.                    <xsl:value-of select="@module"/>
  186.                </xsl:otherwise>
  187.              </xsl:choose>
  188.         
  189.             <xsl:text>  Date: </xsl:text>
  190.             <xsl:value-of select="time:LocalTime(.)"/>
  191. <!--                <xsl:value-of select="@dateTimeLast" />-->
  192.             <xsl:if test="@user">
  193.               <xsl:text>  User: </xsl:text> 
  194.                           <B>[<xsl:value-of select="@user" />] </B>
  195.             </xsl:if> 
  196.             <xsl:if test="@domain">
  197.               <xsl:text> Domain: </xsl:text>
  198.                 <B>[<xsl:value-of select="@domain" />] </B>
  199.             </xsl:if> 
  200.             
  201.          </div>
  202.          <div style="float: right;   text-align: right; width:5%;  ">
  203.                     <xsl:choose>
  204.                     <xsl:when test="$Filter//sort='App'">
  205.                         <xsl:variable name="thisApp" select="App"/>
  206.                         <xsl:variable name="thisUser" select="@user"/>
  207.                         <xsl:variable name="thisDomain" select="@domain"/>
  208.                         <xsl:variable name="thisModule" select="@module"/>
  209.                         <xsl:variable name="thisAction" select="Action"/>
  210.                         <xsl:variable name="thisMsg" select="Msg"/>
  211.                         <xsl:variable name="thisProt" select="InetDef/@prot"/>
  212.                         <xsl:variable name="thisDir" select="InetDef/@dir"/>
  213.                         <xsl:variable name="thisRemPort" select="InetDef/@remPort"/>
  214.                         <xsl:variable name="thisRemIp" select="InetDef/@remIp"/>
  215.                         <xsl:variable name="equalEvents" select="$Events[
  216.                             (@module=$thisModule) and
  217.                             (App=$thisApp or (count($thisApp)=0 and count(App)=0)) and
  218.                             (@user=$thisUser or (count($thisUser)=0 and count(@user)=0)) and
  219.                             (@domain=$thisDomain or (count($thisDomain)=0 and count(@domain)=0)) and
  220.                             (Action=$thisAction) and
  221.                             (not($thisModule=16) or $thisMsg=Msg) and
  222.                             (not($thisModule=2) or ($thisProt=InetDef/@prot and
  223.                                                     (count($thisDir)=0 and count(InetDef/@dir)=0 or $thisDir=InetDef/@dir) and
  224.                                                     (count($thisRemPort)=0 and count(InetDef/@remPort)=0 or $thisRemPort=InetDef/@remPort) and
  225.                                                     (count($thisRemIp)=0 and count(InetDef/@remIp)=0 or $thisRemIp=InetDef/@remIp)
  226.                                                    )
  227.                             )
  228.                                                     
  229.                             ]"/>
  230.                         <!--B> Count: </B-->
  231.                         <xsl:value-of select="count($equalEvents)"/>
  232.                     </xsl:when>
  233.                     <xsl:otherwise>
  234.                         <xsl:if test="@count">
  235.                              <!--B> Count: </B-->
  236.                             <xsl:value-of select="@count" />
  237.                         </xsl:if>
  238.                     </xsl:otherwise>
  239.                     </xsl:choose>
  240.          </div>
  241.       </div>
  242.      <!--  <xsl:if test="@ruleID">
  243.          <B> RULEID: </B>
  244.          <xsl:value-of select="@ruleID" />
  245.       </xsl:if>
  246.       -->
  247.       <xsl:apply-templates />
  248.        </div>
  249.    </xsl:if>
  250.    </xsl:template>
  251.  
  252. </xsl:stylesheet>
  253.